package operator

import (
	"github.com/gin-gonic/gin"
	"go.uber.org/zap"
	"project/pkg/models"
)

func (h OHandler) SearchOpToTeacher(c *gin.Context) {
	resp := new(models.RespData)
	page, size, err := models.GetPageInfo(c)
	if err != nil {
		resp.SendServerBusy(c)
		return
	}
	teacherId := c.Query("teacher_id")
	info, count, err := h.M.OpSearchByTeacherId(teacherId, page, size)
	if err != nil {
		zap.L().Error("Op:UpdateInfo h.M.OpSearchByTeacherId err", zap.Error(err))
		resp.SendServerBusy(c)
		return
	}
	resp.Data = info
	resp.Count = count
	resp.SendSuccessToLayUi(c)
}
